package offer2

/*
原题链接:
https://leetcode.cn/problems/ti-huan-kong-ge-lcof/description/

剑指 Offer 5.替换空格

示例 1：
输入：s = "We are happy."
输出："We%20are%20happy."
*/
func replaceSpace(s string) string {
	str := ""
	for _, v := range s {
		if v == ' ' {
			str += "%20"
		} else {
			str += string(v)
		}
	}

	return str
}
